from DrissionPage import Chromium

browser = Chromium()
tab = browser.new_tab('https://www.baidu.com')

position = tab.ele('xpath://*[@id="s-top-left"]/a[8]')
print(position.text)
print(position.html)
print(position.after(1).link)
# 视口坐标
print(position.rect.viewport_midpoint)
# 屏幕坐标
print(position.rect.screen_location)

baidu_logo = tab.ele('@id=s_lg_img')
baidu_logo.save(name='百度')


